#ifndef STUWINDOW_H
#define STUWINDOW_H

#include <QWidget>
#include <QCloseEvent>
#include "stu_record.h"
#include "stu_borrow.h"
#include "stu_return.h"

namespace Ui {
class StuWindow;
}

class StuWindow : public QWidget
{
    Q_OBJECT

public:
    explicit StuWindow(QWidget *parent = nullptr);
    ~StuWindow();

signals:
    /* 学生界面关闭信号 */
    void close();

    /* 学生登录信号 */
    void stulogin(QString name);

    /* 更新列表 */
    void updataView();

public slots:
    void getStuname(QString name);

protected:
    /* 学生界面关闭事件 */
    void closeEvent(QCloseEvent *event);

private slots:
    void on_recordBtn_clicked();

    void on_borrowBtn_clicked();

    void on_returnBtn_clicked();

private:
    /* 页面初始化 */
    void initPage();

private:
    Ui::StuWindow *ui;

    stu_record *m_recordPage;

    stu_borrow *m_borrowPage;

    stu_return *m_returnPage;

    QString m_stuName;
};

#endif // STUWINDOW_H
